# Array30
SET(UUID "fe1125da-3bff-47b8-9aa7-d7586633ae4a")
SET(ICON_FILE "array30.png")
SET(TABLE_NAME_EN "Array30")
SET(TABLE_NAME_ZH "行列30")
SET(DESC "Array 30 Chinese input method.")

SET(ARRAY30_HEAD_IN "${CMAKE_CURRENT_SOURCE_DIR}/array30.head.in")
SET(ARRAY30_TAIL "${CMAKE_CURRENT_SOURCE_DIR}/array30.tail")

SET(ARRAY30_BASE "${CMAKE_CURRENT_BINARY_DIR}/array30")
SET(ARRAY30_BASE_UTF8 "${ARRAY30_BASE}.utf8")
SET(ARRAY30_BASE_FREQ "${ARRAY30_BASE}.freq")
SET(ARRAY30_BASE_TABLE "${ARRAY30_BASE}.tab")
SET(ARRAY30_BASE_HEAD "${ARRAY30_BASE}.head")

CONFIGURE_FILE(${ARRAY30_HEAD_IN} ${ARRAY30_BASE_HEAD} @ONLY)

CONVERT_ENCODING(${ARRAY30_BASE_UTF8} UTF16 array30_27489.txt)
GENERATE_FREQ(${ARRAY30_BASE_FREQ}
    ${ARRAY30_BASE_UTF8}
    )

MAKE_TABLE_SOURCE_TXT(${ARRAY30_BASE_TABLE}
    ${ARRAY30_BASE_HEAD} ${ARRAY30_BASE_FREQ} ${ARRAY30_TAIL}
    )

# Array30-big
SET(UUID "3c28e5f1-0885-486e-8d15-b13680b9a44c")
SET(ICON_FILE "array30-big.png")
SET(TABLE_NAME_EN "Array30BigTable")
SET(TABLE_NAME_ZH "行列30大字集")
SET(DESC "Array 30 Chinese input method that include unicode Ext B.")

SET(ARRAY30_BIG "${CMAKE_CURRENT_BINARY_DIR}/array30-big")
SET(ARRAY30_BIG_UTF8 "${ARRAY30_BIG}.utf8")
SET(ARRAY30_BIG_FREQ "${ARRAY30_BIG}.freq")
SET(ARRAY30_BIG_TABLE "${ARRAY30_BIG}.tab")
SET(ARRAY30_BIG_HEAD "${ARRAY30_BIG}.head")

CONFIGURE_FILE(${ARRAY30_HEAD_IN} ${ARRAY30_BIG_HEAD} @ONLY)

SET(ARRAY30_EXT_B_UTF8 ${CMAKE_CURRENT_BINARY_DIR}/array30_ExtB.utf8)
CONVERT_ENCODING(${CMAKE_CURRENT_BINARY_DIR}/array30_ExtB.utf8 UTF16 array30_ExtB.txt)

SET(ARRAY30_EXT_CD_UTF8 ${CMAKE_CURRENT_BINARY_DIR}/array30_ExtCD.utf8)
CONVERT_ENCODING(${CMAKE_CURRENT_BINARY_DIR}/array30_ExtCD.utf8 UTF16 array30_ExtCD_V2012A.txt)

ADD_CUSTOM_COMMAND(OUTPUT ${ARRAY30_BIG_UTF8}
    COMMAND cat ${ARRAY30_BASE_UTF8}
    ${ARRAY30_EXT_B_UTF8}
    ${ARRAY30_EXT_CD_UTF8}
    > ${ARRAY30_BIG_UTF8}
    DEPENDS ${ARRAY30_BASE_UTF8} ${ARRAY30_EXT_B_UTF8} ${ARRAY30_EXT_CD_UTF8}
    VERBATIM
    )

GENERATE_FREQ(${ARRAY30_BIG_FREQ}
    ${ARRAY30_BIG_UTF8}
    )


MAKE_TABLE_SOURCE_TXT(${ARRAY30_BIG_TABLE}
    ${ARRAY30_BIG_HEAD} ${ARRAY30_BIG_FREQ} ${ARRAY30_TAIL}
    )

CONVERT_DB(array ${ARRAY30_BASE_TABLE} ${ARRAY30_BIG_TABLE})

